#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class Solution
{
public:
    int minRectanglesToCoverPoints(vector<vector<int>> &points, int w)
    {
        vector<int> hasPoint;
        for (auto p : points)
        {
            hasPoint.emplace_back(p[0]);
        }
        std::sort(hasPoint.begin(), hasPoint.end());
        int rectCount = 0;
        int lastX = -1000000001;
        for (auto x : hasPoint)
        {
            if (x > lastX + w)
            {
                rectCount += 1;
                lastX = x;
            }
        }
        return rectCount;
    }
};
int main()
{
    cout << "Code3111" << endl;
    Solution s;
    std::vector<std::vector<int>> points = {{2, 1}, {1, 0}, {1, 4}, {1, 8}, {3, 5}, {4, 6}};
    cout << s.minRectanglesToCoverPoints(points, 1) << endl;
    return 0;
}